import java.sql.SQLOutput;
import java.util.Scanner;

/**
 * Created with IntelliJ IDEA.
 * Description:
 * User: dell
 * Date: 2022-11-09
 * Time: 22:28
 */
public class DataDemo {
    public static void main(String[] args) {
        Scanner scan = new Scanner(System.in);
        System.out.println("请输入两个数: ");
        int a = scan.nextInt();
        int b = scan.nextInt();
        while ((a % b) != 0){
            int c = a % b;
            a = b;
            b = c;
        }
        System.out.println("最大公约数是" + b);
    }
}
